package com.netease.nie.base.threadpool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 
 * @author KingsHunter
 * @createDate July 16th,2016
 *
 */
public class SingleExecutorTask {
	
	private ExecutorService es = Executors.newSingleThreadExecutor();
	
	private static SingleExecutorTask executorTask = new SingleExecutorTask();
	
	private SingleExecutorTask() {
	}
	
	public static SingleExecutorTask getInstance() {
		return executorTask;
	}
	
	public void executer(Runnable task) {
		try {
			if (!es.isShutdown())
				es.execute(task);
		} catch (Exception e) {
			
		}
		
	}
}
